package com.springboot.frame.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.springboot.frame.enums.SexType;
import com.springboot.frame.enums.ValidEnum;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;

/**
 * <p>
 *
 * </p>
 *
 * @author liheng
 * @since 2020-12-28
 */
@TableName("enum_test")
public class EnumTest implements Serializable {

    private static final long serialVersionUID=1L;

      @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 1男0女
     */
    @TableField("sex")
    @ValidEnum(enumClass = SexType.class)
    private SexType sex;

    @TableField("nickname")
    @NotBlank(message = "vvvvvvvvvvv")
    private String nickname;


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public SexType getSex() {
        return sex;
    }

    public void setSex(SexType sex) {
        this.sex = sex;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    @Override
    public String toString() {
        return "EnumTest{" +
        "id=" + id +
        ", sex=" + sex +
        ", nickname=" + nickname +
        "}";
    }
}
